package net.liteheaven.xblib.widget.alpha;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

/**
 * Created by liangy on 2016/9/20.
 */
public class XButton extends Button {
    public XButton(Context context) {
        super(context);
    }

    public XButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public XButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public void setPressed(boolean pressed) {
        super.setPressed(pressed);
        setAlpha(pressed ? .5f : 1f);
    }
}
